<form class="am-form" id="batchEditForm">
    <table class="am-table am-table-bordered am-table-radius am-table-hover">
        <tr>
            <th style="width:20%">升级包</th>
            <td style="width:25%"><%=package.name%></td>
            <th style="width:20%">模块</th>
            <td style="width:25%"><%=package.module%></td>
        </tr>
        <tr>
			<th>升级内容描述</th>
			<td colspan="3"><%=package.description%></td>
        </tr>
        <tr>
			<th>是否重启</th>
			<td><%if (package.is_need_reboot===1) {%><span style="color:#ec5656;font-weight:bold;">需要重启</span><%} else {%>不需要<%}%></td>
			<th>是否清除weblogic缓存</th>
			<td><%if (package.is_need_clearcache===1) {%><span style="color:#ec5656;font-weight:bold;">需要清除</span><%} else {%>不需要<%}%></td>
        </tr>
        <tr>
			<th>是否先删除服务器文件(classes目录)</th>
			<td><%if (package.is_need_delfile===1) {%><span style="color:#ec5656;font-weight:bold;">需要删除</span><%} else {%>不需要<%}%></td>
			<th>是否手动执行脚本</th>
			<td><%if (package.is_need_exescript===1) {%><span style="color:#ec5656;font-weight:bold;">需要执行</span><%} else {%>不需要<%}%></td>
        </tr>
        <tr>
            <th>责任人</th>
            <td colspan="3"><span style="color:#ec5656;font-weight:bold;"><%=package.leader_username%></span></td>
        </tr>
        <tr>
			<th>创建人</th>
			<td><%=package.create_username%></td>
			<th>创建时间</th>
			<td><%=package.create_time_display%></td>
        </tr>
        <tr>
			<th>发布人</th>
			<td><%=package.publish_username%></td>
			<th>发布时间</th>
			<td><%=package.publish_time_display%></td>
        </tr>
        <tr>
            <th>部署人</th>
            <td><%=package.deploy_username%></td>
            <th>部署时间</th>
            <td><%=package.deploy_time_display%></td>
        </tr>
    </table>
    <div style="text-align: right;margin-top: 16px;margin-right: 10px;">
    	<div style="float:left;">下载升级包，升级完成后，请点击“确认完成升级”进行确认操作！</div>
    	<button type="button" id="info-download" class="am-btn am-btn-primary am-radius">下载升级包</button>
        <button type="button" id="info-confirm" class="am-btn am-btn-success am-radius">确认完成升级</button>
    	<button type="button" id="info-confirm-validate" class="am-btn am-btn-warning am-radius">确认完成验证</button>
    	<button type="button" id="info-close" class="am-btn am-btn-default am-radius">关闭</button>
	</div>
</form>

<script type="text/javascript">
$(function () {
	$('#info-download').click(function() {
        window.open('/simpleDownUpgradePackage/downloadZipFile?id=<%=package.id%>');
    });

    $('#info-confirm').click(function() {
        zeroModal.confirm({
            content: '确认已完成升级吗？',
            okFn: function() {
                $.ajax({
                    url: '/simpleDownUpgradePackage/doFinishDeploy',
                    dataType: "json",
                    type: "post",
                    data: 'id=<%=package.packageProjectId%>',
                    success: function(data) {
                        if (data.success) {
                            $.toast({ text: '操作成功！', showHideTransition: 'slide', icon: 'success', position: 'top-center' });
                        } else {
                            $.toast({ text: '操作失败！', showHideTransition: 'slide', icon: 'error', position: 'top-center' });
                        }
                        zeroModal.closeAll();
                    }
                });
            }
        });
    }); 

    $('#info-confirm-validate').click(function() {
        zeroModal.confirm({
            content: '确认验证完成吗？',
            okFn: function() {
                $.ajax({
                    url: '/simpleDownUpgradePackage/doFinishValidate',
                    dataType: "json",
                    type: "post",
                    data: 'id=<%=package.packageProjectId%>',
                    success: function(data) {
                        if (data.success) {
                            $.toast({ text: '操作成功！', showHideTransition: 'slide', icon: 'success', position: 'top-center' });
                        } else {
                            $.toast({ text: '操作失败！', showHideTransition: 'slide', icon: 'error', position: 'top-center' });
                        }
                        zeroModal.closeAll();
                    }
                });
            }
        });
    });

    $('#info-close').click(function() {
        zeroModal.closeAll();
    });
});
</script>